package com.lantosec.hmrp.modules.archives.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.archives.vo.UserContractVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 合同信息表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-06-09
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserContract extends BaseEntity<UserContractVO> {

    private static final long serialVersionUID = 1L;
    public UserContract(UserContractVO vo){
        this.userContractId = vo.getUserContractId();
        this.userId = vo.getUserId();
        this.contractNo = vo.getContractNo();
        this.deadline = vo.getDeadline();
        this.startDate = vo.getStartDate();
        this.endDate = vo.getEndDate();
        this.trialDeadline = vo.getTrialDeadline();
        this.trialStartDate = vo.getTrialStartDate();
        this.trialEndDate = vo.getTrialEndDate();
        this.compensation = vo.getCompensation();
        this.damage = vo.getDamage();
        this.attachment = vo.getAttachment();
        this.remark = vo.getRemark();
        this.createId = vo.getCreateId();
        this.createUser = vo.getCreateUser();
        this.createTime = vo.getCreateTime();
        this.verifyId = vo.getVerifyId();
        this.verifyUser = vo.getVerifyUser();
        this.verifyTime = vo.getVerifyTime();
        this.verifyStatus = vo.getVerifyStatus();
    }

    @Override
    public UserContractVO convertToVO(){
        return new UserContractVO(this);
    }


    /**
     * 合同ID
     */
    @TableId(value = "user_contract_id", type = IdType.ASSIGN_UUID)
    private String userContractId;

    /**
     * user主表ID
     */
    private String userId;

    /**
     * 合同编号
     */
    private String contractNo;

    /**
     * 合同期限（月）
     */
    private Integer deadline;

    /**
     * 合同开始时间
     */
    private String startDate;

    /**
     * 合同结束时间
     */
    private String endDate;

    /**
     * 试用期限（月）
     */
    private Integer trialDeadline;

    /**
     * 试用开始时间
     */
    private String trialStartDate;

    /**
     * 试用结束时间
     */
    private String trialEndDate;

    /**
     * 经济补偿金
     */
    private BigDecimal compensation;

    /**
     * 赔偿金
     */
    private BigDecimal damage;

    /**
     * 合同附件
     */
    private String attachment;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建人ID
     */
    private String createId;

    /**
     * 创建人姓名
     */
    private String createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 审核人ID
     */
    private String verifyId;

    /**
     * 审核人姓名
     */
    private String verifyUser;

    /**
     * 审核时间
     */
    private Date verifyTime;

    /**
     * 审核状态（0：未审核，1：以审核）
     */
    private Integer verifyStatus;


    public enum ColName {
        user_contract_id, user_id, contract_no, deadline, start_date, end_date, trial_deadline, trial_start_date, trial_end_date, compensation, damage, attachment, remark, create_id, create_user, create_time, verify_id, verify_user, verify_time, verify_status, 
    }
}
